<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8"/>
	<meta name="baidu-site-verification" content="JdMif0g2tL" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>angular</title>
</head>
<body ng-app="myApp">
<style type="text/css" media="screen">
	*{
		margin: 0;
		padding: 0;
	}
</style>

<div ng-controller="appCtrl">
	<my-time>
		<p>北京时间：{{time}}</p>
	</my-time>
</div>

<script type="text/javascript">
	document.getElementsByTagName('html')[0].style.fontSize=window.screen.width/10+'px';
</script>
<script src="../js/angular.min.js" charset="utf-8"></script>
<script type="text/javascript">
	var app =angular.module('myApp', []);
	
	app.controller('appCtrl', ['$scope', function($scope){
		$scope.abc='hellow';
	}]);
	app.directive('myTime', [function () {
		return {
			restrict: 'E',
			templateUrl:'time.html',
			transclude:true,
			controller:function($scope){
				var date=new Date();
				$scope.time=date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();
			}
		};
	}])
</script>
</body>
</html>
<!--应该是13.8，时间-2017-05-07->